<?php
$params = array_merge(
    require __DIR__ . '/../../common/config/params.php',
    require __DIR__ . '/../../common/config/params-local.php',
    require __DIR__ . '/params.php',
    require __DIR__ . '/params-local.php'
);

return [
    'id'                  => 'app-console',
    'basePath'            => dirname(__DIR__),
    'bootstrap'           => ['log'],
    'controllerNamespace' => 'console\controllers',
    'aliases'             => [
        '@bower' => '@vendor/bower-asset',
        '@npm'   => '@vendor/npm-asset',
    ],
    'controllerMap'       => [
        'fixture' => [
//            'class'     => 'yii\console\controllers\FixtureController', // 初始配置
            'class'     => 'yii\faker\FixtureController', // 正确的配置
            'namespace' => 'common\fixtures',
        ],
        // 'migrate-school' => [
        //     'class'               => 'yii\console\controllers\MigrateController',
        //     'migrationNamespaces' => ['school\migrations'],
        //     'migrationTable'      => 'migration_school',
        //     // 'migrationPath'       => '@school/migrations',
        //     'migrationPath'       => null,
        // ],
        'migrate' => [
            'class'                  => 'yii\console\controllers\MigrateController',
            'migrationNamespaces'    => [
                'console\migrations',
            ],
            'migrationTable'         => 'migration', // 注意： 从不同命名空间提交的迁移会创建出一份单一的迁移历史， 比如你不能只从某个特定的命名空间去提交或者还原迁移。
            'migrationPath'          => null,  // allows to disable not namespaced migration completely
            'templateFile'           => '@console/views/migrations/migration.php',
            'generatorTemplateFiles' => [
                'create_table'    => '@console/views/migrations/createTableMigration.php',
                'drop_table'      => '@console/views/migrations/dropTableMigration.php',
                'add_column'      => '@console/views/migrations/addColumnMigration.php',
                'drop_column'     => '@console/views/migrations/dropColumnMigration.php',
                'create_junction' => '@console/views/migrations/createTableMigration.php',
            ],
        ],
    ],
    'components'          => [
        'log' => [
            'targets' => [
                [
                    'class'  => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                ],
            ],
        ],
    ],
    'params'              => $params,
];
